package edu.pku.sei.transformation.mtparser;

import lpg.runtime.*;

/**
 *<em>
 *<li>Rule 16:  SingleExpr ::= LogicSemanticsExpr
 *<li>Rule 17:  SingleExpr ::= IfExpr
 *</em>
 *<p>
 *<b>
 *<li>Rule 18:  SingleExpr ::= { CommaExpr }
 *</b>
 */
public class SingleExpr extends Ast implements ISingleExpr
{
    private CommaExpr _CommaExpr;

    public CommaExpr getCommaExpr() { return _CommaExpr; }

    public SingleExpr(IToken leftIToken, IToken rightIToken,
                      CommaExpr _CommaExpr)
    {
        super(leftIToken, rightIToken);

        this._CommaExpr = _CommaExpr;
        initialize();
    }

    public boolean equals(Object o)
    {
        if (o == this) return true;
        if (! (o instanceof SingleExpr)) return false;
        if (! super.equals(o)) return false;
        SingleExpr other = (SingleExpr) o;
        if (! _CommaExpr.equals(other._CommaExpr)) return false;
        return true;
    }

    public int hashCode()
    {
        int hash = super.hashCode();
        hash = hash * 31 + (_CommaExpr.hashCode());
        return hash;
    }

    public void accept(Visitor v) { v.visit(this); }
    public void accept(ArgumentVisitor v, Object o) { v.visit(this, o); }
    public Object accept(ResultVisitor v) { return v.visit(this); }
    public Object accept(ResultArgumentVisitor v, Object o) { return v.visit(this, o); }
}


